import React, { useState } from 'react';
import { ConfigProvider, Button, Switch, Card, Space } from 'antd';
import { theme } from 'antd';

const { defaultAlgorithm, darkAlgorithm, compactAlgorithm } = theme;

const ThemeDemo = ({ onAction, currentTheme }) => {

    return (
        <>
            <Button
                type={currentTheme === 'light' ? 'primary' : 'default'}
                onClick={() => onAction('light')}
            >
                亮色主题
            </Button>
            <Button
                type={currentTheme === 'dark' ? 'primary' : 'default'}
                onClick={() => onAction('dark')}
            >
                暗色主题
            </Button>
            <Button
                type={currentTheme === 'compact' ? 'primary' : 'default'}
                onClick={() => onAction('compact')}
            >
                紧凑主题
            </Button>
        </>
    );
};

export default ThemeDemo;